import os
import sys
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if project_root not in sys.path:
    sys.path.append(project_root)
    
from readlater.database.db_manager import DatabaseManager
from readlater.config.config_manager import ConfigManager
from readlater.ai_processor import ArticleProcessor
from readlater.utils.logger import get_logger


# 启动服务
if __name__ == "__main__":
    logger = get_logger(__name__)
    logger.info("启动服务")

    # 初始化数据库
    config_manager = ConfigManager()
    article_processor = ArticleProcessor()
    # 从数据库中获取所有文章
    articles = article_processor.get_articles_to_process()

    article_processor.process_articles()

    logger.info("服务完成")
   




